import Project from "app/project"

const elements = {
  Project
}
export async function getElement(type) {
  if (elements[type]) {
    return elements[type || "Project"]
  } else {
    let Node = null
    switch (type) {
    case "Source":
      Node = (await import("app/dataSource")).default
      break
    case "DataTable":
      Node = (await import("app/dataTable")).default
      break
    case "TableDetail":
      Node = (await import("app/dataTable/components/tableDetail")).default
      break
    case "AddTable":
      Node = (await import("app/dataTable/components/insertTable")).default
      break
    case "DataExchange":
      Node = (await import("app/dataExchange")).default
      break
    case "DataExchangeDetail":
      Node = (await import("app/dataExchange/components/dataExchangeDetail")).default
      break
    case "DataExchangeAdd":
      Node = (await import("app/dataExchange/components/addExchange")).default
      break
    case "DataAnalysis":
      Node = (await import("app/dataAnalysis")).default
      break
    case "DataAnalysisDetail":
      Node = (await import("app/dataAnalysis/components/analysisDetail")).default
      break
    case "DataAnalysisAdd":
      Node = (await import("app/dataAnalysis/components/addAnalysis")).default
      break
    case "VisitLog":
      Node = (await import("app/visitLog")).default
      break
    case "VisitUserManage":
      Node = (await import("app/visitManage")).default
      break
    case "SystemLog":
      Node = (await import("app/systemManager/components/systemLog")).default
      break
    case "AccountManage":
      Node = (await import("app/accountManage")).default
      break
    case "ChangePwd":
      Node = (await import("app/user/components/changePwd")).default
      break
    case "AuthorityManage":
      Node = (await import("app/authorityManage")).default
      break
    case "VisitManage":
      Node = (await import("app/visitManage")).default
      break
    }
    elements[type] = Node
    return Node
  }
}